/*
 * =====================================================================================
 *
 *       Filename:  create_new_password.cpp
 *
 *    Description:  
 *
 *        Version:  1.0
 *        Created:  02/28/2018 02:18:49 PM
 *       Revision:  none
 *       Compiler:  gcc
 *
 *         Author:  YOUR NAME (), 
 *   Organization:  
 *
 * =====================================================================================
 */
#include <stdlib.h>
#include <stdio.h>
#include <iostream>

using namespace std;

inline int randInt(int a, int b)
{
    if(a > b)  
        return b + rand()%(a - b + 1); 
    else
        return a + rand()%(b - a + 1); 
}

int create_new_passwd()
{
    std::string a = "abcdefghijkmnpqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789";
    char rand_str[5]="";

    for (int i = 0; i < 4; ++i) 
    {    
        int j = randInt(0, 55); 

        rand_str[i] = a[j];
    }    
    std::string password = rand_str;
    printf("%s\n", password.c_str());
    return 0;

}

int mian()
{

}


int main()
{
    srand(time(0));
    for(int i = 0; i < 100; ++i)
    {
        create_new_passwd();
    }
    return 0;
}
